$main-class: theme-appbar;

@mixin burger-shared-style {
  position: absolute;
  background-color: #000;
  width: 18px;
  height: 2px;
}

@mixin burger-shared-animate {
  -webkit-animation-duration: 300ms;
          animation-duration: 300ms;
  -webkit-animation-timing-function: ease-in-out;
          animation-timing-function: ease-in-out;
}

.#{$main-class} {
  width: auto;
  -webkit-transition: padding .3s cubic-bezier(0,0,.2,1);
  transition: padding .3s cubic-bezier(0,0,.2,1);
  @media (min-width: 1024px) {
    body.mdui-drawer-body-left & {
      padding-left: 240px;
    }
  }
  &:after {
    position: absolute;
    right: 0px;
    bottom: -5px;
    left: 0px;
    width: 100%;
    height: 5px;
    content: "";
    -webkit-transition: opacity 0.4s;
    transition: opacity 0.4s;
    pointer-events: none;
    opacity: 0;
    -webkit-box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
            box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
    will-change: opacity;
  }
  &.#{$main-class}--shadow:after {
    opacity: 1;
  }
}

.#{$main-class}__progress {
  $sub-class: #{$main-class}__progress;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 1;
  -webkit-transition: opacity 0.3s cubic-bezier(0, 0, 0.2, 1);
  transition: opacity 0.3s cubic-bezier(0, 0, 0.2, 1);
  &.#{$sub-class}--hidden {
    opacity: 0;
  }
}

.#{$main-class}__burger {
  $sub-class: #{$main-class}__burger;
  &.#{$sub-class}--drawer {
    span {
      background-color: #fff;
      &:before {
        background-color: #fff;
      }
      &:after {
        background-color: #fff;
      }
    }
  }
  span {
    @include burger-shared-style;
    top: 11px;
    left: 3px;
    &:before {
      @include burger-shared-style;
      content: '';
      top: -5px;
      left: 0;
    }
    &:after {
      @include burger-shared-style;
      content: '';
      top: 5px;
      left: 0;
    }
  }
  &.#{$sub-class}--menu span {
    @include burger-shared-animate;
    -webkit-animation-name: burger-menu;
            animation-name: burger-menu;
    &:before {
      @include burger-shared-animate;
      -webkit-animation-name: burger-menu-before;
              animation-name: burger-menu-before;
      content: '';
      top: -5px;
      left: 0;
    }
    &:after {
      @include burger-shared-animate;
      -webkit-animation-name: burger-menu-after;
              animation-name: burger-menu-after;
      content: '';
      top: 5px;
      left: 0;
    }
  }
  &.#{$sub-class}--arrow span {
    -webkit-animation-name: burger-arrow;
            animation-name: burger-arrow;
    -webkit-animation-fill-mode: forwards;
            animation-fill-mode: forwards;
    top: 11px;
    left: 3px;
    &:before {
      -webkit-animation-name: burger-arrow-before;
              animation-name: burger-arrow-before;
      -webkit-animation-fill-mode: forwards;
              animation-fill-mode: forwards;
      content: '';
      left: 0;
      top: -5px;
    }
    &:after {
      -webkit-animation-name: burger-arrow-after;
              animation-name: burger-arrow-after;
      -webkit-animation-fill-mode: forwards;
              animation-fill-mode: forwards;
      content: '';
      left: 0;
      top: 5px;
    }
  }

  &.#{$sub-class}--arrow-animate span {
    @include burger-shared-animate;
    &:before {
      @include burger-shared-animate;
    }
    &:after {
      @include burger-shared-animate;
    }
  }
}

@-webkit-keyframes burger-arrow {
  0% { }
  100% {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg);
  }
}

@keyframes burger-arrow {
  0% { }
  100% {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg);
  }
}

@-webkit-keyframes burger-arrow-before {
  0% { }
  100% {
    -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
    width: 12px;
    margin: 0 9px;
    top: -3.5px;
  }
}

@keyframes burger-arrow-before {
  0% { }
  100% {
    -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
    width: 12px;
    margin: 0 9px;
    top: -3.5px;
  }
}

@-webkit-keyframes burger-arrow-after {
  0% { }
  100% {
    -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
    width: 12px;
    margin: 0 9px;
    top: 3.5px;
  }
}

@keyframes burger-arrow-after {
  0% { }
  100% {
    -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
    width: 12px;
    margin: 0 9px;
    top: 3.5px;
  }
}

@-webkit-keyframes burger-menu {
  0% {
    -webkit-transform: rotate(-180deg);
            transform: rotate(-180deg);
  }
  100% { }
}

@keyframes burger-menu {
  0% {
    -webkit-transform: rotate(-180deg);
            transform: rotate(-180deg);
  }
  100% { }
}

@-webkit-keyframes burger-menu-before {
  0% {
    -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
    width: 12px;
    margin: 0 9px;
    top: -3.5px;
  }
  100% { }
}

@keyframes burger-menu-before {
  0% {
    -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
    width: 12px;
    margin: 0 9px;
    top: -3.5px;
  }
  100% { }
}

@-webkit-keyframes burger-menu-after {
  0% {
    -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
    width: 12px;
    margin: 0 9px;
    top: 3.5px;
  }
  100% { }
}

@keyframes burger-menu-after {
  0% {
    -webkit-transform: rotate(-45deg);
            transform: rotate(-45deg);
    width: 12px;
    margin: 0 9px;
    top: 3.5px;
  }
  100% { }
}
